<?php
include('common_include.php');
include('validateSession.php');

$orderID = $_POST["orderID"];
$updatedStatus = $_POST["updatedStatus"];

echo $orderID;
echo $updatedStatus;

$dao = new SQLitePersistence();

try {
	$orderHeaderObj = new OrderHeader();
	$orderHeaderObj->setOrderId($orderID);
	$orderHeaderObj->setStatus($updatedStatus);
	$dao -> updateOrderHeader($orderHeaderObj);
	header("Location: successPage.php?msg=Settlement order has been update successfully.");
} catch (Exception $e) {
	header("Location: errorPage.php?error=Settlement order failed to update.");
}

unset($dao);
?>